forum

home / developersection / forums / position:relative wrapping and element height?

Position:relative wrapping and element height?

Anonymous User 2377 04-Apr-2013
Hi Everyone!

I have a simple TextArea and a button

When the button is clicked , I need to wrap (exactly) the text area with a red div (border:solid 1px red)

p.s this wrapper div must be position:relative because I need to add future absolute positioned elements

And so I wrote this code :

$(".btn").on('click',function (){

 $(".myTextArea").wrap($('<span/>', {
                    "class": 'msgAbsWrap',
                    "style": "position:relative;display:inline" /*it's inline by default ,I know*/

                }));
});

Advance Thanks!

Updated on 04-Apr-2013

I am a content writter !


Message
Can you answer this question?

Answer

2 Answers

Liked By